<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=7,IE=9" />
<!--The viewport meta tag is used to improve the presentation and behavior of the samples 
      on iOS devices-->
<meta name="viewport"
	content="initial-scale=1, maximum-scale=1,user-scalable=no" />
<title>Map with WMS</title>
<link rel="stylesheet" type="text/css"
	href="http://serverapi.arcgisonline.com/jsapi/arcgis/2.8/js/dojo/dijit/themes/claro/claro.css">
<style>
html,body {
	height: 98%;
	width: 98%;
	margin: 0;
	padding: 5px;
}
</style>
<script type="text/javascript">
	var djConfig = {
		parseOnLoad : true
	};
</script>
<script type="text/javascript"
	src="http://serverapi.arcgisonline.com/jsapi/arcgis/?v=2.8"></script>
<script type="text/javascript"
	src="wms.js"></script>	

<script type="text/javascript">
	dojo.require("dijit.layout.BorderContainer");
	dojo.require("dijit.layout.ContentPane");
	dojo.require("dijit.layout.AccordionContainer");
	dojo.require("esri.map");
	dojo.require("esri.layers.wms");

	var map;

	function init() {
		esri.config.defaults.io.proxyUrl = "proxy.jsp";
		var initExtent = new esri.geometry.Extent({
			"xmin" : -19000410,
			"ymin" : 860986,
			"xmax" : 606604,
			"ymax" : 8570731,
			"spatialReference" : {
				"wkid" : 102100
			}
		});
		map = new esri.Map("map", {
			extent : initExtent
		});
		var basemap = new esri.layers.ArcGISTiledMapServiceLayer(
				"http://services.arcgisonline.com/ArcGIS/rest/services/World_Street_Map/MapServer");
		//map.addLayer(basemap);

		

		var wmsLayer = new esri.layers.WMSLayer(
				"http://sampleserver1.arcgisonline.com/ArcGIS/services/Specialty/ESRI_StatesCitiesRivers_USA/MapServer/WMSServer");
		//set visible layers - in this case US Cities
		wmsLayer.setVisibleLayers([ 2 ]);
		wmsLayer.setImageFormat("png");
		//map.addLayer(wmsLayer);
		
		myWMSLayer my = new myWMSLayer();
		my.setVisibleLayers([ 2 ]);
		my.setImageFormat("png");
		map.addLayer(my);

		dojo.connect(map, 'onLoad', function(theMap) {
			//resize the map when the browser resizes
			dojo.connect(dijit.byId('map'), 'resize', map, map.resize);
		});
	}

	dojo.addOnLoad(init);
</script>
</head>

<body class="claro">
	<div id="content" dojotype="dijit.layout.BorderContainer"
		design="headline" gutters="true"
		style="width: 100%; height: 100%; margin: 0;">
		<div id="map" dojotype="dijit.layout.ContentPane" region="center"
			style="overflow: hidden;"></div>
	</div>
</body>

</html>